package net.bwie.jtp.dws.log.utils;

import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;

import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

public class AnalyzerUtil {
    // TODO: 2025/5/20 使用ik分词器对文本进行普通分词 
    public static List<String> ikAnalyzer(String content) throws Exception {
        List<String> list = new ArrayList<>();
        IKSegmenter ikSegmenter = new IKSegmenter(new StringReader(content),true);
        // TODO: 2025/5/20 遍历
        Lexeme  lexeme;
        while((lexeme = ikSegmenter.next())!=null){
            //String text = lexeme.getLexemeText();
            list.add(lexeme.getLexemeText());
        }
        return list;
    }
    





    



}
